import 'package:enterprise_v6_app/app/core/values/colors.dart';
import 'package:enterprise_v6_app/app/core/values/images.dart';
import 'package:enterprise_v6_app/app/modules/application/double_prevention_page/danger_investigation_page/task_allocation_hazard_investigation/task_allocation_allocated/task_allocation_allocated_view.dart';
import 'package:enterprise_v6_app/app/modules/application/double_prevention_page/danger_investigation_page/task_allocation_hazard_investigation/task_allocation_hazard_investigation_controller.dart';
import 'package:enterprise_v6_app/app/modules/application/double_prevention_page/danger_investigation_page/task_allocation_hazard_investigation/task_assigned/task_assigned_view.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

///隐患排查任务分配
class TaskAllocationHazardInvestigationPage extends StatelessWidget {
  TaskAllocationHazardInvestigationPage({super.key}){
    Get.lazyPut(TaskAllocationHazardInvestigationController.new);
  }
  @override
  Widget build(BuildContext context) {
    final TaskAllocationHazardInvestigationController controller = Get.find<TaskAllocationHazardInvestigationController>();
    return Container(
      color: AppColors.bg_color_grey,
      child: DefaultTabController(
        length: 2,
        initialIndex: controller.initPage,
        child: Column(
          children: [
            Container(
              padding: EdgeInsets.symmetric(horizontal: 30.w),
              decoration: const BoxDecoration(
                color: Colors.white,
              ),
              height: 54.w,
              child: TabBar(
                enableFeedback: false,
                tabs: const [
                  Tab(text: '已分配'),
                  Tab(text: '待分配'),
                ],
                dividerColor: Colors.transparent,
                labelPadding: EdgeInsets.only(bottom: 10.w),
                labelStyle: TextStyle(
                  fontSize: 16.sp,
                  fontWeight: FontWeight.w500,
                ),
                unselectedLabelStyle: TextStyle(
                  fontSize: 16.sp,
                  fontWeight: FontWeight.w500,
                ),
                labelColor: Colors.black,
                unselectedLabelColor: const Color(0xffA0A7B5),
                indicatorPadding: EdgeInsets.only(top: 36.w, bottom: 10.w),
                indicator: const BoxDecoration(
                  image: DecorationImage(
                    image: AssetImage(
                      AppImages.icon_app_work_plan,
                    ),
                  ),
                ),
              ),
            ),
            Expanded(
              child: Container(
                color: const Color(0xffF5F5F6),
                child: TabBarView(
                  children: [
                    TaskAssignedPage(),
                    TaskAllocationAllocatedPage(),
                  ],
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
